/* 
 * Copyright 2013-2020 Modeliosoft
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *       http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 */
package org.modelio.api.module.propertiesPage;

import java.util.List;
import com.modeliosoft.modelio.javadesigner.annotations.objid;
import org.modelio.vcore.smkernel.mapi.MObject;

/**
 * Interface defining a module's property view.
 * <p>
 * The main methods are {@link #update(List, IModulePropertyTable)} and {{@link #changeProperty(List, int, String)}}, respectively used
 * to display the property page's content, and to update the a field's value.
 * <p>
 * All modules should extend {@link AbstractModulePropertyPage} instead of implementing this interface.
 */
@objid ("00d00158-0001-5d8c-0000-000000000000")
public interface IModulePropertyPage extends IModulePropertyPanel {
    /**
     * This method is called to provide the properties that will populate the module properties view.
     * <p>
     * Overwrite this method in the class generated by MDA Designer to provide properties.
     * <p>
     * By default, nothing is done when the table should be updated.
     * @param elements the elements to load the properties from.
     * @param table the property page's data model.
     */
    @objid ("3d68fb06-0edf-11e2-b457-002564c97630")
    void update(List<MObject> elements, IModulePropertyTable table);

    /**
     * This method is called when the user modify the value of a property.
     * <p>
     * Overwrite this method to modify the model when the user modify a value.
     * <p>
     * By default, nothing is done when a property is changed.
     * @param elements the elements to change the properties into.
     * @param row the line of the modified property.
     * @param value the value set in the property.
     */
    @objid ("3d69221c-0edf-11e2-b457-002564c97630")
    void changeProperty(List<MObject> elements, int row, String value);
}

